package com.myteam.mystory.fragment;

import java.util.ArrayList;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import com.myteam.mystory.R;
import com.myteam.mystory.adapter.BookmarkAdapter;
import com.myteam.mystory.customview.CustomGridViewDrag;

@SuppressLint("ValidFragment")
public class BookmarkFragment extends Fragment {

	private Context context;
	private String[] bookmark_namestory;
	private GridView bookmark_gridview;

	public BookmarkFragment(Context context) {
		this.context = context;
		}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		View rootView = inflater.inflate(R.layout.bookmark, container, false);
		bookmark_gridview = (GridView) rootView.findViewById(R.id.bookmark_gridview);
		bookmark_namestory = new String[]{"adfasgf","agđgadf","agfdsagag","agfhagfd","agfag","agfah","agfahg","agah","aghadhf","agfah"};
		
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i <bookmark_namestory.length; ++i) {
			list.add(bookmark_namestory[i]);
		}
		
		BookmarkAdapter adapter = new BookmarkAdapter(context, R.id.bookmark_nameStory, list);
//		bookmark_gridview.setCheeseList(list);
		bookmark_gridview.setAdapter(adapter);
		bookmark_gridview.setChoiceMode(GridView.CHOICE_MODE_SINGLE);
		return rootView;
	}
}
